﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Linq;
using System.Text;
using UnityEngine;
using ModLoader;

namespace template
{
    public class Commands
    {
        public static NetworkPlayer caller;

        //Add custom commands here
        public static void ping()
        {
            Hook.Tell(caller, "pong!");
        }

        public static void kick(string name, string reason)
        {
            try
            {
                NetworkTools.kick((NetworkPlayer)Reference.player.GetValue(NetworkUserList.getUserFromID(Hook.IDFromName(name))), reason);
            }
            catch (Exception)
            {
                Hook.Tell(caller, "That player is not connected.");
            }
        }

        public static void kick(string name)
        {
            kick(name, "You were kicked.");
        }
    }
}